home *** CD-ROM | disk | FTP | other *** search
- /* initboard.c - InitBoard */
-
- #include "mac/quickdraw.h"
- #include "mac/osintf.h"
- #include "mac/toolintf.h"
- #include "othello.h"
-
- BoardArray GameBoard =
- { 03, 03, 03, 03, 03, 03, 03, 03, 03, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 00, 00, 00, 00, 00, 00, 00, 00, 03,
- 03, 03, 03, 03, 03, 03, 03, 03, 03, 03 };
-
- short InitPosition[BOARDSIZE+2][BOARDSIZE+2] =
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 20, 3, 4, 4, 4, 4, 3, 20, 0,
- 0, 3, -7, -1, -1, -1, -1, -7, 3, 0,
- 0, 4, -1, 0, 0, 0, 0, -1, 4, 0,
- 0, 4, -1, 0, 0, 0, 0, -1, 4, 0,
- 0, 4, -1, 0, 0, 0, 0, -1, 4, 0,
- 0, 4, -1, 0, 0, 0, 0, -1, 4, 0,
- 0, 3, -7, -1, -1, -1, -1, -7, 3, 0,
- 0, 20, 3, 4, 4, 4, 4, 3, 20, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- /*
- * InitBoard:
- * Set up the playing board.
- */
-
- InitBoard()
- {
- int i, j;
-
- /* Initialize positional weights */
- for (i = 1; i <= BOARDSIZE; ++i)
- for (j = 1; j <= BOARDSIZE; ++j)
- position[i][j] = InitPosition[i][j];
-
- /* Put stones in center to start game. */
- for (i = 4; i <= 5; ++i)
- for (j = 4; j <= 5; ++j)
- PlaceStone(i, j, ((i+j) % 2)? stoneWhite : stoneBlack);
- }
-